Skip to content

Conversation

@mao-sz
Copy link
Contributor

@mao-sz mao-sz commented Feb 8, 2026

Because

Carries on and supersedes #27381.

We start the JavaScript course a little too in the deep end by diving rather quickly into constructors and using objects, but don't really explore a lot of why we would want to use objects in general in the first place, i.e. the more conceptual stuff around code organisation.

Notable changes from original PR

  • Some examples changed to hopefully demonstrate more justifiable situations. Some felt a little too contrived, with room for questions like "why not just do XYZ instead?"

  • Reduced scope for the organisation lesson.

    After discussion with other team members, we found it difficult to keep the content around public/private in the organisation lesson without it either creeping out of scope with stuff better covered in later lessons, or becoming too contrived that it didn't seem to have as much learning value as intended. Teaching in detail about using _ properties for pseudo-privacy felt like a little too much weight on encapsulation at the wrong time, where it felt more appropriate with things that would actually implement privacy. A brief mention of _ properties for awareness, particularly for legacy code, felt more appropriate for this lesson at least.

    This also tied into the piggy bank assignment which I decided to remove, as without public/private stuff, or things like constructors/factories, felt too contrived to be of significant practical value. Also struggled to find good readings that stayed within this lesson's scope, without going into constructors, classes, inheritance and SOLID etc. Ultimately, I decided on "no assignment", given the more "preparing understanding of concepts" intent behind the new lesson.

    Open to counter ideas though.

This PR

  • Extracts object/organisation contents from constructors lesson and expands on it in new lesson
  • Renames constructors lesson to reflect reduced scope
  • Amends constructors and factory functions lessons to account for content now introduced in new lesson

Issue

Closes #27375

Additional Information

Only to be merged after TheOdinProject/theodinproject#5228

Pull Request Requirements

  • I have thoroughly read and understand The Odin Project curriculum contributing guide
  • The title of this PR follows the location of change: brief description of change format, e.g. Intro to HTML and CSS lesson: Fix link text
  • The Because section summarizes the reason for this PR
  • The This PR section has a bullet point list describing the changes in this PR
  • If this PR addresses an open issue, it is linked in the Issue section
  • If any lesson files are included in this PR, they have been previewed with the Markdown preview tool to ensure it is formatted correctly
  • If any lesson files are included in this PR, they follow the Layout Style Guide

mao-sz and others added 20 commits February 8, 2026 15:53
Continuing from TheOdinProject#27381
Co-authored-by: Bradley Finney <77649883+takinabradley@users.noreply.github.com>
Now in the new "Organizing Code with Objects" lesson
Goes beyond a sensible scope for this lesson, involving outdated
practices.

True privacy is covered in later lessons and only an awareness of the
idea of privacy and `_` syntax is sufficient.
Lightbulb example demonstrated two simple methods but could raise
questions like "why not just assign the property directly?"
Tricky to answer with this example without going off on a tangent, especially given
the removal of the private/public interface content.

The car example's methods should teach the same points but provide a
more justified example of using methods over direct/manual interaction.
Double quotes more commonly used across our whole curriculum for JS
Only about constructors now - organisational stuff extracted to separate
lesson
Either they'd go out of scope or end up just repeating what the lesson
already covers (or already integrated into the lesson in a previous
change).
Just introducing the term.
Considered putting it in a separate small section before the data
structure bit, but felt it would put too much weight on the idea and
people would start looking too deeply into namespacing in isolation.
Tough decision.
The original assignment, especially without the public/private stuff,
felt a bit too contrived without as much practical learning value.
Possible readings generally covered much more scope than this lesson
(i.e. constructors/classes, inheritance encapsulation etc.)

Instead of trying to find an assignment for the sake of an assignment, I
felt it would be more sensible to omit an actual assignment since this
lesson is mostly basic conceptual "preparation" for the coming lessons
and projects.
Clearer separation between "IIFE" and "module pattern" concepts
Actually demonstrate privatisation and need for function rather than
just using an object literal directly.

Namespacing mention removed as it'll now be brought up in an earlier
lesson
May have been true in earlier times, but especially with classes coming
up later, I'd hesitate to use this language right now. I'd rather the
context just be presenting an alternative approach than thinking this
fully replaces something else because "bad"
@github-actions github-actions bot added the Content: JavaScript Involves the JavaScript course label Feb 8, 2026
mao-sz added a commit to TheOdinProject/theodinproject that referenced this pull request Feb 9, 2026
@mao-sz mao-sz merged commit 2c1898f into TheOdinProject:main Feb 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content: JavaScript Involves the JavaScript course

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Organizing Your JavaScript Code: Add more context as to why objects are useful for organizing code

2 participants